package com.sskj.givecoin.v.activity;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.sskj.givecoin.R;
import com.sskj.givecoin.common.App;
import com.sskj.givecoin.utils.ClickUtil;
import com.sskj.givecoin.v.base.BaseActivity;

import butterknife.BindView;

import static com.sskj.givecoin.common.Constants.VERIFY_IDENT_CODE;

/**
 * ProjectName：期权
 * DESC: (类描述)  认证失败
 * Created by hqf on 2018/10/16 9:07
 * updateName:(修改人名称)
 * updateTime:(修改时间)
 * updateDesc:(修改内容)
 */
public class SecurityFailedActivity extends BaseActivity<SecurityFailedPresenter> {

    @BindView(R.id.faild_reason)
    TextView faildReason;
    @BindView(R.id.reset_security)
    TextView resetSecurity;
    @BindView(R.id.security_failed_back)
    ImageView securityFailedBack;
    @BindView(R.id.failed_type)
    TextView failedType;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_security_failed;
    }

    @Override
    public SecurityFailedPresenter getPresenter() {
        return new SecurityFailedPresenter();
    }

    public static void start(Context context, String title) {
        Intent starter = new Intent(context, SecurityFailedActivity.class);
        starter.putExtra("title", title);
        context.startActivity(starter);
    }

    @Override
    protected void onViewBinding() {
        super.onViewBinding();
//        failedType.setText(getIntent().getStringExtra("title"));
        mPresenter.requestUserAssetList();
        ClickUtil.click(securityFailedBack, () -> {
            finish();
        });
        ClickUtil.click(resetSecurity, () -> {
            finish();
//            if (App.INSTANCE.getString(R.string.strBaseActivity207).equals(getIntent().getStringExtra("title"))) {
//                VerifyGuideActivity.start(SecurityFailedActivity.this);
//            } else {
//                openActivity(VerifyJuniorActivity.class, VERIFY_IDENT_CODE);
//            }
            startActivity(new Intent(this, VerifyIdentActivity.class));
        });
    }

    public void updateView(String faileReason) {
        faildReason.setText(TextUtils.isEmpty(faileReason) ? "" : App.INSTANCE.getString(R.string.strSecurityFailedActivity203) + faileReason);
    }

}
